/**
 * @Author: yy
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2020-01-06 10:55:48
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 查询报价列表
export const queryQuotationList = params => axios.get(`${SERVER.CYXDMS_CLUE}/customerPrice/customerQuotationList`, { params });

export const queryQuotationListNew = params => axios.get(`${SERVER.CYXDMS_CLUE}/customerPrice/customerQuotationListNew`, { params });
// 新增客户报价
export const insertCustomerPrice = params => axios.post(`${SERVER.CYXDMS_CLUE}/customerPrice/insertCustomerPrice`, params);
// 更改客户报价
export const quotationModification = params => axios.post(`${SERVER.CYXDMS_CLUE}/customerPrice/quotationModification`, params);
// 根据报价id查询报价信息
export const selectPriceById = params => axios.get(`${SERVER.CYXDMS_CLUE}/customerPrice/selectPriceById`, { params });
//  查询销售顾问/网销顾问
export const queryEmployees = params => axios.get(`${SERVER.CYXDMS_CLUE}/clue/employeeList`, { params });
// 根据电话和姓名查询潜客
export const potentialCustomer = params => axios.get(`${SERVER.CYXDMS_CLUE}/potenCus/potentialCustomer`, { params });

/*
 *根据车型获取指导价
 *品牌id：brandId
 *车系id：seriesId
 *车型id：modelId
 *配置id：packageId
 *颜色id：color
 */
export const selectDirectivePrice = params => axios.get(`${SERVER.BASEDATA}/vsProduct/selectDirectivePriceByProductId`, { params });


//导出报价管理列表
export const getQuotationExcelList = params => {
  params = Object.assign(params, { menuId: '-1' });
  return axios({
    url: `${SERVER.CYXDMS_CLUE}/customerPrice/export/excel`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
